﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class ComboBoxBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private ComboBox ComboBox
        {
            get
            {
                return this.Component as ComboBox;
            }
        }


        public ComboBoxBuilder()
            : base(new ComboBox())
        {

        }

        public ComboBoxBuilder(ComboBox ComboBox)
            : base(ComboBox)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public ComboBoxBuilder Set(string property, object value)
        {
            if (this.ComboBox.Properties.ContainsKey(property))
            {
                this.ComboBox.Properties[property] = value;
            }
            else
            {
                this.ComboBox.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerComboBox的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public ComboBoxBuilder Manager(string manager)
        {
            this.ComboBox.Manager = manager;
            return this;
        }


        public ComboBoxBuilder Resize(bool value)
        {
            this.ComboBox.Resize = value;
            return this;
        }
        public ComboBoxBuilder IsMultiSelect(bool value)
        {
            this.ComboBox.IsMultiSelect = value;
            return this;
        }
        public ComboBoxBuilder IsShowCheckBox(bool value)
        {
            this.ComboBox.IsShowCheckBox = value;
            return this;
        }
        public ComboBoxBuilder Columns(bool value)
        {
            this.ComboBox.Columns = value;
            return this;
        }
        public ComboBoxBuilder SelectBoxWidth(bool value)
        {
            this.ComboBox.SelectBoxWidth = value;
            return this;
        }
        public ComboBoxBuilder SelectBoxHeight(bool value)
        {
            this.ComboBox.SelectBoxHeight = value;
            return this;
        }
        public ComboBoxBuilder InitValue(string value)
        {
            this.ComboBox.InitValue = value;
            return this;
        }
        public ComboBoxBuilder InitText(string value)
        {
            this.ComboBox.InitText = value;
            return this;
        }
        public ComboBoxBuilder ValueField(string value)
        {
            this.ComboBox.ValueField = value;
            return this;
        }
        public ComboBoxBuilder TextField(string value)
        {
            this.ComboBox.TextField = value;
            return this;
        }
        public ComboBoxBuilder ValueFieldID(string value)
        {
            this.ComboBox.ValueFieldID = value;
            return this;
        }
        public ComboBoxBuilder Slide(bool value)
        {
            this.ComboBox.Slide = value;
            return this;
        }
        public ComboBoxBuilder Split(string value)
        {
            this.ComboBox.Split = value;
            return this;
        }
        public ComboBoxBuilder Data(string value)
        {
            this.ComboBox.Data = value;
            return this;
        }
        public ComboBoxBuilder Tree(string value)
        {
            this.ComboBox.Tree = value;
            return this;
        }
        public ComboBoxBuilder TreeLeafOnly(bool value)
        {
            this.ComboBox.TreeLeafOnly = value;
            return this;
        }
        public ComboBoxBuilder Grid(string value)
        {
            this.ComboBox.Grid = value;
            return this;
        }
        public ComboBoxBuilder HideOnLoseFocus(bool value)
        {
            this.ComboBox.HideOnLoseFocus = value;
            return this;
        }
        public ComboBoxBuilder Url(string value)
        {
            this.ComboBox.Url = value;
            return this;
        }
        public ComboBoxBuilder Render(string value)
        {
            this.ComboBox.Render = value;
            return this;
        }
        public ComboBoxBuilder Absolute(bool value)
        {
            this.ComboBox.Absolute = value;
            return this;
        }
    }
}